<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>My Events</title>

    <style type="text/css">
        .nameColumn { width: 200px }
        .descriptionColumn { width: 400px }
    </style>
</head>
<body>
<f:view>
<h1>My Events</h1><br/>
<p>
<h:messages infoStyle="color: #000000" errorStyle="color: #ff0000" globalOnly="false"/></p>
	<a href="newEvent.jsf">Add New Event</a><br/>
    <h:form id="myEventsForm">
<h:dataTable value="#{eventHandler.myEvents}" var="event"
                 columnClasses="nameColumn, descriptionColumn">
        <h:column>
            <f:facet name="header"><h:outputText value="Name" /> </f:facet>
            <h:outputText value="#{event.name}" />
        </h:column>
        <h:column>
            <f:facet name="header"><h:outputText value="Description" /> </f:facet>
            <h:outputText value="#{event.description}" />
        </h:column>
        <h:column>
            <f:facet name="header"><h:outputText value="Start Date" /> </f:facet>
            <h:outputText value="#{event.startDate}" >
            <f:convertDateTime/></h:outputText>
        </h:column>
        <h:column>
            <f:facet name="header"><h:outputText value="End Date" /> </f:facet>
            <h:outputText value="#{event.endDate}" >
            <f:convertDateTime/></h:outputText>
        </h:column>
        <h:column>
            <f:facet name="header"><h:outputText value="Action" /> </f:facet>
            <h:commandLink action="#{eventHandler.modify}" value="Modify" >
            	<f:param name="currentEventId" value="#{event.eventId}" />
            </h:commandLink>
        </h:column>
        
    </h:dataTable>
    </h:form>
    <br />
    <a href="home.jsf">Home</a>
</f:view>
</body>
</html>